/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package screen;


import framework.Key;
import framework.Menu;
import framework.MenuListener;
import framework.Screen;
import framework.Text;
import framework.Util;
import game_shooter.GameScreenShooter;
import game_shooter.GameScreenShooter_2;
import game_shooter.GameScreenShooter_3;
import main.Global;
import main.Midlet;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 *
 * @author marcos
 */
public class SelectGameScreen extends Screen implements MenuListener {
    private Image img;
    private Menu menu;

    public void loadResources() {
        Text.setFont(Global.EVADER_FONT_BLACK, 12, 8);
        img = Util.loadImage(Global.SELECT_IMG_GAMEPAD);

        String []items = new String[]{"SPACE ASTEROIDS", "SPACE COLLECTOR", "CROSSROADS IN SPACE"};
        menu = new Menu(items, 40, 220, 160, this);
        menu.setBackgroundColor(0xAAAAAA);
    }

    public void initGame() {
    }
    
    public void paint(Graphics g) {
        Screen.clear(g, 0xFFFFFF);
        Util.drawImage(img, Util.CENTER, 10, g);
        Text.drawText("SELECIONE O JOGO", Text.CENTER, 200, g);
        Util.drawCommand("SAIR", Util.COMMAND_LEFT, g);
        menu.paint(g);
    }

    public void update() {
        menu.update();
        if (Key.ACTION_LEFT) {
            Midlet.getInstance().exit();
        }
    }

    public void menuAction(int menuIndex) {
        switch(menuIndex) {
            case 0:
              //  Screen.setCurrentScreen(new GameScreenAsteroids());
                break;
            case 1:
               // Screen.setCurrentScreen(new GameScreenCollector());
                break;
            case 2:
                Screen.setCurrentScreen(new GameScreenShooter());
                break;
        }
    }
}
